package cn.jtfadmin.base.lang.config.statuscode;

import cn.jtfadmin.base.lang.config.WebConfig;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException;

import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.Path;
import java.util.*;

/**
 * 参数错误
 *
 * @author jtf
 * @see StatusCodeConfig
 * @see StatusCodeManager
 * @see WebConfig#configureHandlerExceptionResolvers(List)
 * @since 0.0.1
 */
@Component
public class NoResultErrorStatusCodeConfig implements ExceptionStatusCodeConfig {

    /**
     * 参数错误
     */
    public static final Integer ERROR = 504;
    public static final String ERROR_MSG = "数据查询错误,结果不存在";


    public static final ExceptionStatusDescribe DEFAULT_ERROR_STATUS_DESCRIBE =
            new ExceptionStatusDescribe(ERROR_MSG, ERROR, NoSuchElementException.class) ;

    @Override
    public Set<ExceptionStatusDescribe> getExStatusDecribes() {
        Set<ExceptionStatusDescribe> set = new HashSet<>();
        set.add(DEFAULT_ERROR_STATUS_DESCRIBE);
        return set;
    }


}
